class AttendsController < ApplicationController
  
  def index
    redirect_to(pdsessions_path)
  end
  
  def create
    @pdsession = Pdsession.find(params[:id])
    @attend = Attend.new
    @attend.pdsession = @pdsession
    @attend.user = current_user
    @attend.save
    redirect_to(pdsessions_path)
  end
  
  def destroy
    @attend = current_user.attends.find_by_pdsession_id(params[:id])
    @attend.destroy
    redirect_to(pdsessions_path)
  end
  
end
